Class HCC.DT.HCC2HL72.DischargeInfoQue Extends Ens.DataTransformDTL [ DependsOn = (EnsLib.EDI.XML.Document, EnsLib.HL7.Message) ]
{

Parameter IGNOREMISSINGSOURCE = 1;

Parameter REPORTERRORS = 1;

Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.EDI.XML.Document' targetClass='EnsLib.HL7.Message' sourceDocType='PRPA_IN900300UV:PRPA_IN900300UV' targetDocType='2.5.1:ADR_A19' create='new' language='objectscript' >
<assign value='source.{id().extension}' property='target.{MSH:MessageControlID}' action='set' />
<assign value='source.{creationTime().value}' property='target.{MSH:DateTimeOfMessage.Time}' action='set' />
<assign value='"ADR"' property='target.{MSH:MessageType.MessageCode}' action='set' />
<assign value='"A19"' property='target.{MSH:MessageType.TriggerEvent}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.queryId().extension}' property='target.{QRD:QueryID}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.patientId.value().item(1).extension}' property='target.{EVNgrp(1).PID:PatientID.IDNumber}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.patientId.value().item(2).extension}' property='target.{EVNgrp().PID:PatientIdentifierList(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.encounterTimeframe.value().low.value}' property='target.{EVNgrp().EVN:RecordedDateTime.Time}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.encounterTimeframe.value().high.value}' property='target.{EVNgrp().EVN:DateTimePlannedEvent.Time}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.responsibleOrganization.value().item().extension}' property='target.{EVNgrp().EVN:EventFacility}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.typeOfEncounter.value().item().displayName.value}' property='target.{EVNgrp().EVN:EventTypeCode}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.patientLocationID.value().item(1).extension}' property='target.{EVNgrp().PV1:AssignedPatientLocation.Facility}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.patientLocationID.value().item(2).extension}' property='target.{EVNgrp().PV1:AssignedPatientLocation.Floor}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.careEventID.value().item().extension}' property='target.{EVNgrp().PID:AlternatePatientIDPID(1).IDNumber}' action='set' />
<assign value='source.{controlActProcess().queryByParameter.dischargingPractitionerID.value().item().extension}' property='target.{EVNgrp().EVN:OperatorID(1)}' action='set' />
</transform>
}

}
